package com.game.element
{
	public class ZhiLiaoYaoShui extends ItemElement
	{
		public var addHp:Number = 50;
		public function ZhiLiaoYaoShui() {
			super();
			this.graphics.clear();
			this.graphics.beginFill(0xFF0000,1);
			this.graphics.drawRect(-5,-5,10,10);
			this.graphics.endFill();
		}
		
		override public function useing(baseElement:BaseElement):Boolean{
			if(!baseElement is PlayerElement){
				return false;
			}
			var playerElement: PlayerElement = baseElement as PlayerElement
			playerElement.hp += addHp;
			if(playerElement.hp > playerElement.maxHp){
				playerElement.hp = playerElement.maxHp;
			}
			playerElement.hpBar.setValue(playerElement.hp,playerElement.maxHp);
			return true;
		}
	}
}